package com.chang.rentmall.daos;

import com.chang.rentmall.beans.CustomerBean;
import com.chang.rentmall.beans.OrderBean;
import com.chang.rentmall.beans.PageBean;
import com.chang.rentmall.beans.QueryBean;
import com.chang.rentmall.forms.OrderFormBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderDao {
    public int addOrder(OrderBean orderBean);
    public int updateOrder(OrderBean orderBean);
    public List<OrderBean> getOrdersByShop(@Param("order") OrderFormBean orderFormBean);
    public List<CustomerBean> getCustomersByShop(@Param("query") QueryBean queryBean, @Param("pagination") PageBean pageBean);

    /**
     * 查询某个店铺下某个客户的订单
     * @param queryBean
     * @param pageBean
     * @return List<OrderBean>
     */
    public List<OrderBean> getShopOrdersByUser(@Param("query") QueryBean queryBean, @Param("pagination") PageBean pageBean);

    /**
     * 根据用户查询订单
     * @param queryBean
     * @param pageBean
     * @return
     */
    public List<OrderBean> getOrdersByUser(@Param("query") QueryBean queryBean, @Param("pagination") PageBean pageBean);

    /**
     * 删除用户订单
     * @param orderNumber
     * @return
     */
    public int deleteOrder (@Param("orderNumber") String orderNumber);

    public OrderBean getOrderByNumber(@Param("orderNumber") String orderNumber);
}
